# -*- coding: utf-8 -*-
"""
Created on Tue May 21 14:02:23 2024

@author: 29865
"""

from sklearn.impute import SimpleImputer# 导入数据预处理中的填充模块Imputer
import pandas as pd
import numpy as np
c = np.array([[1, 2, 3, 4], [4, 5, 6, np.nan], [
             5, 6, 7, 8], [9, 4, np.nan, 8]])  # 数组c
C = pd.DataFrame(c)  # 数据框C

imp = SimpleImputer(missing_values=np.nan, strategy='mean')  # 创建按列均值填充策略对象
FC=imp.fit_transform(C) #返回填充后的数据集FC